/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Service;

import DAO.CompanyDAO;
import DAO.MarketDAO;
import Entity.Company;
import Entity.Market;
import VO.CompanyVO;
import VO.MarketVO;
import javax.persistence.EntityManager;

/**
 *
 * @author usuario
 */
public class MarketService {
    
    public void persistMarket(MarketVO vo, EntityManager em){
        Market entityAdmin = new Market();
        entityAdmin.setId(vo.getIdMarket());
        entityAdmin.setNameMarket(vo.getNameMarket());
        entityAdmin.setNemoMarket(vo.getNemoMarket());
        entityAdmin.setDescriptionMarket(vo.getDescriptionMarket());
        
        MarketDAO.persistMarket(entityAdmin, em);
    }
    
    public void removeMarket(MarketVO vo, EntityManager em){
         Market entityAdmin = new Market();
        entityAdmin.setId(vo.getIdMarket());
        entityAdmin.setNameMarket(vo.getNameMarket());
        entityAdmin.setNemoMarket(vo.getNemoMarket());
        entityAdmin.setDescriptionMarket(vo.getDescriptionMarket());
         MarketDAO.removeMarket(entityAdmin,em);
     }
    
}
